<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>表单页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        .form-group {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 5px;
        }
        input[type="text"],
        input[type="number"] {
            width: 100%;
            padding: 8px;
            box-sizing: border-box;
        }
        button {
            padding: 10px 15px;
            background-color: #007bff;
            color: white;
            border: none;
            cursor: pointer;
        }
        button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
<h1>表单填写</h1>
<form action="#" th:action="@{/submitForm}" th:object="${formData}" method="post">
    <div class="form-group">
        <label for="phoneNumber">手机号（11位手机号）</label>
        <input type="text" id="phoneNumber" name="phoneNumber"  pattern="^\d{11}$" title="请输入11位手机号" required>
    </div>
    <div class="form-group">
        <label for="numberOfPeople">成人人数</label>
        <input type="number" id="numberOfPeople" name="numberOfPeople" min="1" th:value="0" required>
    </div>
    <div class="form-group">
        <label for="numberOfChildren">儿童人数</label>
        <input type="number" id="numberOfChildren" name="numberOfChildren" th:value="0" min="0" required>
    </div>
    <div class="form-group">
        <label for="chargeAmount">收取费用</label>
        <input type="number" id="chargeAmount" name="chargeAmount" step="0.01" required>
    </div>
    <button type="submit">提交</button>
</form>
</body>
</html>
